//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Spreadsheet
{
    public class FileRecoveryProperties : IOfficeXmlSerializable
    {
        #region IOfficeXmlSerializable Members

        void IOfficeXmlSerializable.ReadXml(ReadContext context)
        {
            using (ReadContext c = context.Read("fileRecoveryPr"))
            {
                AutoRecover = c.GetOptionalBoolean("autoRecover", true);

                crashSave = c.GetOptionalBoolean("crashSave", false);
                dataExtractLoad = c.GetOptionalBoolean("dataExtractLoad", false);
                repairLoad = c.GetOptionalBoolean("repairLoad", false);
            }
        }

        void IOfficeXmlSerializable.WriteXml(WriteContext context)
        {
            using (WriteContext c = context.Write("fileRecoveryPr"))
            {
                c.SetOptionalBoolean("autoRecover", AutoRecover, true);

                c.SetOptionalBoolean("crashSave", crashSave, false);
                c.SetOptionalBoolean("dataExtractLoad", dataExtractLoad, false);
                c.SetOptionalBoolean("repairLoad", repairLoad, false);
            }
        }

        #endregion
        private bool autoRecover;

        public bool AutoRecover
        {
            get { return autoRecover; }
            set { autoRecover = value; }
        }
        private bool crashSave;

        public bool CrashSave
        {
            get { return crashSave; }
            set { crashSave = value; }
        }
        private bool dataExtractLoad;

        public bool DataExtractLoad
        {
            get { return dataExtractLoad; }
            set { dataExtractLoad = value; }
        }
        private bool repairLoad;

        public bool RepairLoad
        {
            get { return repairLoad; }
            set { repairLoad = value; }
        }



    }
}
